package com.akkainaction.mailbox.config;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import com.akkainaction.mailbox.config.actor.ControlAwareActor;
import com.akkainaction.mailbox.config.message.ControlMsg;
import com.typesafe.config.ConfigFactory;

import java.util.Arrays;
import java.util.List;

public class TestControlAwareActor {

    public static void main(String[] args) {
        ActorSystem system = ActorSystem.create("sys", ConfigFactory.load("control-aware-mailbox-conf"));
        ActorRef controlAwareActor = system.actorOf(Props.create(ControlAwareActor.class).withMailbox("control-aware-mailbox"), "controlAwareActor");
        List<Object> messageList = Arrays.asList("JAVA", "C#", new ControlMsg("CPP"), "GO", "SCALA");
        for (Object message : messageList) {
            controlAwareActor.tell(message, ActorRef.noSender());
        }
    }
}
